<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>易淘二手商城</title>
    <link rel="stylesheet" type="text/css" href="/static/css/style.css">
    <link rel="stylesheet" href="/static/css/layui.css" media="all">
    <style>
        body {
            width: 100%;

        }

        .myli {
            font-size: 45px;
            color: #FF5722;
            margin-top: 20px;
            margin-right: 10px;
        }

        /*.myfooter{
            margin-top: 60px;
        }*/
    </style>
</head>

<body>
<!-- top1  个人中心-->
<header>
    <div class="top center">
        <div class="right fr">
            {% if user_id %}
                <a href="{{ url_for('user.userInfo') }}">
                    <div class="gouwuche fr">个人中心</div>
                </a>
            {% else %}
                <div class="fr">
                    <ul>
                        <li><a href="{{ url_for('user.login') }}" target="_blank">登录</a></li>
                        <li>|</li>
                        <li><a href="{{ url_for('user.register') }}" target="_blank">注册</a></li>
                    </ul>
                </div>
            {% endif %}


            <div class="clear"></div>
        </div>
        <div class="clear"></div>
    </div>
</header>
<!--end header -->

<!-- top2 search-->
<div class="banner_x center">
    <a href="{{ url_for('user.index') }}" taget="_blank">
        <i class="layui-icon layui-icon-home fl myli"></i>
    </a>
    <div class="nav fl">
        <ul style="margin-left:50px;">
            <li><a href="/user/itemList/手机">手机</a></li>
            <li><a href="/user/itemList/电脑平板">电脑平板</a></li>
            <li><a href="/user/itemList/服饰鞋包">服饰鞋包</a></li>
            <li><a href="/user/itemList/二手书籍">二手书籍</a></li>
            <li><a href="/user/itemList/家居家电">家居家电</a></li>
            <li><a href="/user/itemList/生活百货">生活百货</a></li>
            <li><a href="/user/itemList/健身器材">健身器材</a></li>
            <li><a href="/user/itemList/智能硬件">智能硬件</a></li>
            <li><a href="/user/nearby">同城</a></li>
        </ul>
    </div>
    <!--search 框-->
    <div class="search fr">
        <form action="{{ url_for('user.search') }}" method="post">
            <div class="text fl">
                <input type="text" class="shuru" name="search" placeholder="请输入需要的商品">
            </div>
            <div class="submit fl">
                <input type="submit" class="sousuo" value="搜索"/>
            </div>
            <div class="clear"></div>
            <div id="tips" style="display: none;
        	width: 171px;  border: 1px solid ";>
           </div>
        </form>
        <div class="clear"></div>
    </div>
</div>
<!-- top2 -->

<!-- 巨幕   轮播图-->
<div style="width: 70%; height:300px;margin: auto;margin-top: 20px;">
    <div class="layui-carousel" id="lunbo">
        <div carousel-item style="text-align: center; ">
            <div class="layui-bg-green"><img src="/static/image/lunbo2.jpg" style="width: 1300px;"/></div>
            <div class="layui-bg-orange"><img src="/static/image/lunbo1.jpg"/></div>
            <div class="layui-bg-red"><img src="/static/image/lunbo3.jpg" style="width: 1300px;"/></div>
        </div>
    </div>
</div>

<!-- end banner -->

<!-- 商品推荐 -->
<div class="danpin center">

    <div class="biaoti center">
        {{ msg }}
    </div>
    <div class="main center">
        {% for item in items %}
            <div class="mingxing fl">
                <a href="/user/detail/{{ item.item_id }}">
                    <div class="sub_mingxing">
                        <a href="/user/detail/{{ item.item_id }}">
                            <img src="{{ item.pic1 }}" alt="">
                        </a>
                    </div>


                    <div class="pinpai">
                    {{ item.itemName }}</a></div>
            <div class="youhui">{{ item.detail }}</div>
            <div class="jiage">{{ item.price }}￥</div>
            </a>
            </div>
        {% endfor %}

    <div class="clear"></div>
</div>
</div>

<footer class="mt20 center layui-bg-black">
     <div class="copyright">
        <h2>易淘二手商城版权所有</h2>
    </div>
</footer>
<script src="/static/js/layui.js"></script>
<script type="text/javascript" src="/static/js/jquery-3.3.1.js"></script>
<script type="text/javascript" src="/static/js/socket.io.js"></script>
<script>
    $(document).ready(function () {
        namespace = '/index';
        var socket = io.connect(location.protocol + '//' + document.domain + ':' + location.port + namespace);

        socket.on('freshen', function (res) {
            console.log(res);
            console.log("页面刷新成功")
            if (res.code ==200) {
               location.href='/user/index';
            }
        });
    })
</script>


<script>
    layui.use('carousel', function () {
        var carousel = layui.carousel;
        //建造实例
        carousel.render({
            elem: '#lunbo',
            width: '100%' //设置容器宽度
            ,
            arrow: 'always' //始终显示箭头
            //,anim: 'updown' //切换动画方式
        });
    });
</script>



</body>
</html>